package ltd.dujiabao.listener;

import ltd.dujiabao.event.EmailEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author : DuJiabao
 * @Project : spring
 * @Time : 2021/5/13 14:05
 * @Desc :
 */
@Component
public class EmailListener implements ApplicationListener<EmailEvent> {
  @Override
  public void onApplicationEvent(EmailEvent emailEvent) {
    System.out.println("收到一封邮件");
    System.out.println("地址 ： " + emailEvent.getAddress());
    System.out.println("内容 ： " + emailEvent.getText());
  }
}
